fix(lint): searchable-fields hints prescribe a stored field, not formula (#6673) - #6921
Merged
os-project-manager merged 1 commit intoAug 9, 2026
Conversation
…ula (#6673) Both authoring-time hints for a bad `searchableFields` entry told the author to mirror a related record's value onto a formula field — a fix that can never work: a `formula` field is virtual (no driver materializes a column for it), so a `$contains` predicate against one has nothing to scan, and a CEL formula only reads the record's own fields, so it cannot fetch the related title in the first place. - validate-searchable-fields.ts:347 (dotted-path entry, SEARCHABLE_FIELD_UNKNOWN): "copy the value onto a formula field here" -> "...a stored text field here." - validate-searchable-fields.ts:414 (lookup/master_detail outside the allowed set, SEARCHABLE_FIELD_UNSEARCHABLE): "mirror it onto a text/formula field" -> "mirror it onto a stored text field". Matches the prescription already shipped in content/docs/data-modeling/ schema-design.mdx and the objectstack-data / objectstack-ui skills (PR #6670, #6898) — the tool's own hint text now agrees with the corpus that quotes it. Pinned tests strengthened to assert the new wording and reject "formula" (reverse-verified: reverting either string to the old wording turns both tests red).
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 3 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This was referenced Aug 9, 2026
os-project-manager
marked this pull request as ready for review
August 9, 2026 04:36
os-project-manager
deleted the
claude/issue-6673-searchable-fields-stored-hint
branch
August 9, 2026 04:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6673
What changed
Both authoring-time hints for a bad
searchableFieldsentry prescribed mirroring a related record's value onto a formula field — a fix that can never work: aformulafield is virtual (no driver materializes a column for it —packages/objectql/src/engine.ts,driver-sql/src/schema-drift.ts,driver-turso/src/remote-transport.ts), so a$containspredicate against one has nothing to scan, and a CEL formula only reads the record's own fields (record.<field>), so it cannot fetch the related title in the first place.packages/lint/src/validate-searchable-fields.ts::347(dotted-path entry,searchable-field-unknown): "…or copy the value onto a formula field here." → "…or copy the value onto a stored text field here.":414(alookup/master_detailcolumn outside the allowed set,searchable-field-unsearchable): "…mirror it onto a text/formula field here…" → "…mirror it onto a stored text field here…"This matches the prescription already shipped in
content/docs/data-modeling/schema-design.mdxand theobjectstack-data/objectstack-uiskills (PR #6670, #6898) — the tool's own hint text now agrees with the corpus that quotes it.Pinned tests in
validate-searchable-fields.test.tswere strengthened to assert the new wording and reject"formula". Reverse-verified: reverting either string to the old wording turns both tests red (confirmed locally before restoring the fix).Scope note — the third string does not exist where the issue described it
The issue also named a third target:
packages/metadata-protocol/src/protocol.ts:4780, described as "the runtime dotted-path hint inassertSearchFieldsAreSearchable", currently reading "a formula or rollup field".I verified this against
origin/mainand it does not hold up:assertSearchFieldsAreSearchable(protocol.ts:4978, the#4254SEARCH-FIELDS ingress gate) has no formula/rollup prescription at all — its dotted-path hint only says"'search' scans this object's own columns; a related record's column cannot be a search target."(protocol.ts:5056).git log -S "formula" -- packages/metadata-protocol/src/protocol.tsshows the string "formula" was never present in this function, in the file's entire history.:4780("Denormalise the value onto '${object}' (a formula or rollup field that copies it into a real column) and sort by that.") actually lives inassertSortFieldsExist(protocol.ts:4745) — the SORT axis,#4226/#4256, an unrelated code path guarding?sort=/orderBy, notsearchableFields.#4256(same author, closedcompleted) asked for and got, and it is still consistent with its own, still-current documentation (content/docs/protocol/objectql/query-syntax.mdx:533-534, "Denormalise the value onto the queried object (for example with a formula or rollup field) when you need to sort by it."). Docs and code agree there today — there is no docs-vs-tool contradiction on the SORT axis, unlike thesearchableFieldscase this issue is about.packages/objectql/src/query-expression-conformance.test.ts:455), outside both packages this card named.So this PR only touches the two
packages/lintstrings, which are exactly as described and now fixed. I'm leavingprotocol.tsuntouched — filing the (possibly real, but separate and cross-domain) SORT-axis question as its own finding for triage rather than guessing at it here. Details in my report to the dispatching PM.Tests
pnpm exec vitest run src/validate-searchable-fields.test.ts(packages/lint) — 33/33 pass.pnpm exec vitest run(packages/lint, full suite) — 1762 passed, 4 skipped.pnpm --filter lint typecheck— clean.pnpm exec eslint packages/lint/src/validate-searchable-fields.ts packages/lint/src/validate-searchable-fields.test.ts --no-inline-config— clean.node scripts/check-nul-bytes.mjs— OK.dist/).Changeset
Added
.changeset/searchable-fields-stored-hint.md(patch,@objectstack/lint) — message-text-only fix to a published package's diagnostic output; matches this repo's own precedent for wording-only diagnostic fixes (e.g..changeset/fault-edge-tombstone-type.md,.changeset/org-axis-dead-alias-branches.md).Generated by Claude Code